<template>
	
	
	<view class="home">
		<view>
			<liu-rotating-menu :btnObj="btnObj" @click="click"></liu-rotating-menu>
		</view>
		<image
		  mode="widthFix"
		  class="head"
		  src="/static/home8/image-home8-head.png" 
		></image>
		<view class="main">
		  <view class="main-title"> 
			<text>小组成员</text>
		  </view>
 
		  <view class="family">
			<view class="family-item">
			  <image
				mode="widthFix"
				class="family-icon"
				src="/static/home8/zl.png" 
			  ></image>
			  <text>张磊</text>
			</view>
			<view class="family-item">
			  <image
				mode="widthFix"
				class="family-icon"
				src="/static/home8/wxx.png"
			  ></image>
			  <text>王旭星</text>
			</view>
			<view class="family-item">
			  <image
				mode="widthFix"
				class="family-icon"
				src="/static/home8/llj.png"
			  ></image>
			  <text>吕浪杰</text>
			</view>
			<view class="family-item">
			  <image
				mode="widthFix"
				class="family-icon"
				src="/static/home8/px.png"
			  ></image>
			  <text>潘旭</text>
			</view>
		  </view>

		  <view class="main-title">
			<text>登录账号信息</text>
			<image
			  mode="widthFix"
			  class="right-icon"
			  src="/static/home8/icon-home8-time.png"
			  @click="updateUser"
			></image>
		  </view>
		 <view class="footer">
			<view class="left-text">
			<view class="form-row"><text>用户名:</text><input v-model="user.username" type="text"></input></view>
			<view class="form-row"><text>电&nbsp;&nbsp;&nbsp;话:</text><input v-model="user.telephone" type="tel"></input></view>
			<view class="form-row"><text>邮&nbsp;&nbsp;&nbsp;箱:</text><input v-model="user.email" type="email"></input></view>
			</view>
		 </view>	  

		  <view class="main-title">
			<text>小组宣言</text>
			<image
			  mode="widthFix"
			  class="right-icon"
			  src="/static/home8/icon-home8-like.png"
			></image>
		  
		  </view>

		  <view class="footer">
			<view class="left-text">
			  <text>没有打不死的小强</text>
			  <text>只有爬不起来的蟑螂</text>
			  <text style="font-size: 24rpx; font-weight: 400; margin-top: 30file:///E:/下载/team.pngrpx"
				>炒勇小组-宣</text
			  >
			</view>
			<image
			  mode="widthFix"
			  style="width: 200rpx"
			  src="/static/home8/team.png"
			></image>
		  </view>
		</view> 
	  </view>
</template>
	
<script>
	import Vue from 'vue'
	import Router from '@/router'
	export default {
	        data() {
	            return {
					user: {},	
	                btnObj: {
	                    id: '1',
	                    name: '菜单',
	                    childs: [{
	                        id: '1',
	                        name: '主页'
	                    }, {
	                        id: '2',
	                        name: '用户'
	                    }, {
	                        id: '3',
	                        name: '识别'
	                    }]
	                },
					    
	            };
	        },
	        methods: {
	            //点击菜单
	            click(e) {
					if(e.id=="1"){
						uni.showToast({
										title: "您已经在主页面",
										icon: 'success',    
										duration: 2000    //持续时间为 2秒
									})
						console.log('所点击菜单信息：', e)
					}else if(e.id=="2"){
						Router.push({ name:'users'});	
					}else{
						uni.showToast({
										title: "到达功能页面",
										icon: 'success',    
										duration: 2000    //持续时间为 2秒
									})
						console.log('所点击菜单信息：', e)
						Router.push({ name:'passport'});
					}
					
					
	            },
				updateUser(){
					console.log(this.user.id)
					this.$axios
					.put("/updateUser",this.user, {
						headers: {
						  "Content-Type": "application/json"
						}
					  })
					 .then(response=>{
						 uni.setStorageSync('user',this.user)
						 if(response.data.code=200){
							 uni.showToast({
							 				title: response.data.message,
							 				icon: 'success',    
							 				duration: 2000    //持续时间为 2秒
							 			})		
						 }else{
							 uni.showToast({
							 				title: response.data.message,
							 				icon: 'fail',    
							 				duration: 2000    //持续时间为 2秒
							 			})
						 }
					  })
					  .catch(function (error) {
						console.log(error);
					  });
					 
			}
	        },created() {
	        	this.user=uni.getStorageSync('user')
	        	
	        }
	
	    };
</script>

<style scoped>
.home {
  width: 100%;
  height: 100vh;
}
.head {
  width: 100%;
}
.main {
  border-radius: 40rpx 40rpx 0 0;
  padding: 30rpx 40rpx;
  position: relative;
  top: -40rpx;
  z-index: 9;
  background-color: #fff;
}
.main-title {
  display: flex;
  align-items: center;
  font-size: 40rpx;
  font-weight: bold;
  justify-content: space-between;
  margin-top: 30rpx;
}
.right-icon {
  width: 40rpx;
}
.family {
  display: flex;
  margin-top: 30rpx;
}
.family-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-right: 30rpx;
  font-size: 24rpx;
}
.family-icon {
  width: 90rpx;
  margin-bottom: 10rpx;
}
.swiper {
  margin-top: 40rpx;
  height: 360rpx;
}
.card-item {
  border: 2rpx solid rgba(0, 0, 0, 0.1);
  margin-left: 30rpx;
  border-radius: 30rpx;
  padding: 30rpx;
}
.doing {
  font-size: 30rpx;
  font-weight: bold;
  margin-top: 10rpx;
  overflow: hidden; 
  text-overflow: ellipsis;
  display: -webkit-box; 
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; 
}
.status {
  font-size: 25rpx;
  margin-top: 20rpx;
}
.jindu {
  width: 80%;
  height: 12rpx;
  border-radius: 10rpx;
  background-color: #f5f5f5;
  overflow: hidden;
  margin-top: 20rpx;
}
.footer {
  display: flex;
  justify-content: space-between;
  box-shadow: 0 4rpx 8rpx #00000040;
  padding: 25rpx 40rpx;
  border-radius: 25rpx;
  margin-top: 30rpx;
  margin-bottom: 80rpx;
}
.left-text {
  display: flex;
  flex-direction: column;
  font-size: 30rpx;
  color: #6f6f6f;
  font-weight: bold;
}
.form-row {
  display: flex;
  align-items: center;

}

</style>
